package com.cloudcode.enums;

import lombok.Data;
import lombok.Getter;
import lombok.Setter;

@Getter
public enum DocumentTypeEnum {

    TEXT(0, "文档"), BRIEF_INTRODUCTION(1, "简介");

    private final Integer code;
    private final String desc;

    DocumentTypeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static DocumentTypeEnum getCodeValue(Integer code) {
        for (DocumentTypeEnum value : DocumentTypeEnum.values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }
}
